package com.fesine.ch01.lesson07.t12;

/**
 * Created by Fesine on 2016/6/27.
 */
public class MyThread extends Thread {

    @Override
    public void run() {
        super.run();
        for (int i = 0; i < 500000; i++) {

            System.out.println("i = " +(i+1));
        }
    }

    //public static void main(String[] args) {
    //    Thread.currentThread().interrupt();
    //        System.out.println("是否停止1? =" + Thread.interrupted());
    //        System.out.println("是否停止2? =" + Thread.interrupted());
    //    System.out.println("end!");
    //}


    //public static void main(String[] args) {
    //    MyThread thread = new MyThread();
    //    thread.start();
    //    try {
    //        Thread.sleep(2000);
    //        thread.interrupt();
    //        System.out.println("是否停止1? =" + thread.interrupted());
    //        System.out.println("是否停止2? =" + thread.interrupted());
    //    } catch (InterruptedException e) {
    //        System.out.println("main catch");
    //        e.printStackTrace();
    //    }
    //    System.out.println("end!");
    //}


}
